package org.gap.wizards.items.effects;

import org.gap.wizards.creature.Creature;
import org.gap.wizards.creature.Creature.Attribute;
import org.gap.wizards.utils.Dice;

public class IncreaseAttribute extends AttributeEffect {
	public IncreaseAttribute() {
		this(null, null);
	}
	
	public IncreaseAttribute(Attribute attribute, Dice sidedDie) {
		super(attribute, sidedDie);
	}

	@Override
	public void apply(Creature creature) {
		creature.increase(attribute, sidedDie.roll());
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj.getClass().equals(IncreaseAttribute.class)) {
			return super.equals((AttributeEffect)obj);
		}
		return false;
	}
}
